<?php
/**
 * Created by PhpStorm.
 * User: xu.gao
 * Date: 2016/6/7
 * Time: 14:12
 */

namespace App\controllers\Home;

use App\models\Order;
use App\models\User;
use Simple\Controller\Controller;
use Simple\Db\Query;
use Simple\Web\Container;
use Simple\Web\Events;
use Simple\Web\Json;
use Simple\Web\Request;
class IndexController extends Controller
{

    public $userService;
    public function __construct()
    {
        parent::__construct();
        $this->userService = Container::getObj('userService');
    }

    public function index()
    {

        $this->render('index',['name' => 'gaoxuxu']);

    }
    public function test()
    {
        /*$result = (new Query()) ->select('t1.*')
                      ->from(User::tableName().' as t1')
                      ->where(['t1.id' => 1])
                      ->one();
        dump($result);*/

        $user = User::find()->one();

        dump($user);
       /* $user = new User();
        $user->username = 'gaoxx';
        $user->email = '123456';
        $id = $user->save();
        dump($id);*/
    }


}